(import '(java.awt Frame)
	'(java.awt.event WindowListener WindowAdapter KeyListener KeyEvent)
	'(javax.media.opengl GLCanvas GLEventListener GL GLAutoDrawable))

(defn create-canvas [id context-updater]
  (def canvas (new GLCanvas))
  (.addGLEventListener canvas
		       (proxy [GLEventListener] []
			 (display [#^GLAutoDrawable drawable]
				  (doto (.getGL drawable)
				    (.glClear GL/GL_COLOR_BUFFER_BIT)
				    ))
			 
			 (displayChanged [drawable m d])
			 
			 (init [#^GLAutoDrawable drawable]
			       (doto (.getGL drawable)
				 (.glShadeModel (. GL GL_SMOOTH))
				 (.glClearColor 1 0 0 0)
				 (.glClearDepth 1)
				 ))
			 
			 (reshape [#^GLAutoDrawable drawable x y w h]
				  (when (> h 0)
				    (let [gl (.getGL drawable)]
				      (.glMatrixMode gl (. GL GL_PROJECTION))
				      (.glLoadIdentity gl)
				      ;(.gluPerspective glu 50 (/ w h) 1 1000)
				      (.glMatrixMode gl (. GL GL_MODELVIEW))
				      (.glLoadIdentity gl))))
			 ))
  canvas)
  